/**
 * 
 */
package com.zc.BankCreditManagement.ZCUtil;

/**
 * @author ZhangCheng
 * @time 2019年9月24日
 */
public class GetRanNum {
	public String RanNum(int time) {//随机产生所需数目
		String str = "";
		String chars = initRan(48, 57);
		
		for(int i = 0 ;i<time;i++) {
			int ran =(int) (Math.random()*1000%chars.length());
			   str+=chars.substring(ran,ran+1);
		 }     
		    return str;
	}
	public String RanZIMU(int time) {
		String str = "";
		String chars = initRan(65, 90) + initRan(97,122);
		
		for(int i = 0 ;i<time;i++) {
			int ran =(int) (Math.random()*1000%chars.length());
			   str+=chars.substring(ran,ran+1);
		 }     
		    return str;
	}
	
	public String initRan(int begin,int end) {
		String str="";
		for(int i=begin;i<=end;i++) {
			str +=(char) (i);
		}
		return str;
		
	}
}
